package com.firstwave.sfreading;

import com.firstwave.sfreading.service.BookService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.net.URI;

@SpringBootApplication
@RestController
//启用熔断器
@EnableCircuitBreaker
public class SfReadingApplication {
    @Autowired
    private BookService bookService;
    @RequestMapping("/to-read")
    public String toRead(){
        return bookService.readingList();
    }


    public static void main(String[] args) {
        SpringApplication.run(SfReadingApplication.class, args);
    }

}
